import xyRequest from '..'

// GET /user/project/find/{projectId} 通过id找项目
export function getProject(projectId: number) {
  return xyRequest.get({
    url: `/user/project/find/${projectId}`
  })
}

// DELETE /user/project/delete/{projectId} 通过id删除项目
export function deleteProject(projectId: number) {
  return xyRequest.delete({
    url: `/user/project/delete/${projectId}`
  })
}

// POST/user/project/add 新增项目信息
export function addProject(data: any) {
  return xyRequest.post({
    url: '/user/project/add',
    headers: {
      'content-type': 'application/json'
    },
    data: JSON.stringify(data)
  })
}

// PUT /user/project/update 更新项目
export function updateProject(data: any) {
  return xyRequest.put({
    url: '/user/project/update',
    data: data
  })
}
//POST /upload 项目文件上传（Logo/附件）
export function upLoadFile(file: any) {
  return xyRequest.post({
    url: '/upload',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: file,
    timeout: 60000
  })
}
